import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    nav: [],
  },
  // 同步
  mutations: {
    RouterInformation(state, data) {
      state.nav = data;
    },
  },
  // 异步
  actions: {
    RouterInformation({ commit }, data) {
      //同步调用vuex的方法
      commit("RouterInformation", data);
    },
  },
  modules: {},
});
